#include<iostream>
#include<iomanip>
using namespace std;
int main()
{
	int t;
	cin >> t;
	char ch;
	int a, b;
	while (t--) {
		cin >> ch >> a >> b;
		double ans = 0;
		if (ch == '+') {
			cout << a + b << endl;
		}
		else if (ch == '-') {
			cout << a - b << endl;
		}
		else if (ch == '*') {
			cout << a * b << endl;
		}
		else {
			if (a % b == 0) {
				cout << a / b << endl;
			}
			else {
				double ans = 1.0* a / b;
			    //3.434
				//22.335
				//234.4454
				cout << fixed << setprecision(2) << ans << endl;
			}
		}
	}
	return 0;
}